<!DOCTYPE HTML>
<html lang="en" >
    <!-- Start book 我旳电子书 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>flex弹性盒子 | 我旳电子书</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.9">
        <meta name="author" content="Melon">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-image-captions/image-captions.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/02css/textattr.html" />
    
    
    <link rel="prev" href="../../md/02css/transition.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="2.6"
        data-chapter-title="flex弹性盒子"
        data-filepath="md/02css/flex.md"
        data-basepath="../.."
        data-revision="Tue Jun 09 2020 01:19:02 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/01html/HTML.html">
            
                
                    <a href="../../md/01html/HTML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="md/01html/1lebel.html">
            
                
                    <a href="../../md/01html/1lebel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        HTML标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="md/01html/01list.html">
            
                
                    <a href="../../md/01html/01list.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        列表标签
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/02css/01selector.html">
            
                
                    <a href="../../md/02css/01selector.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css选择器
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="md/02css/float.html">
            
                
                    <a href="../../md/02css/float.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="md/02css/background.html">
            
                
                    <a href="../../md/02css/background.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        背景属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="md/02css/position.html">
            
                
                    <a href="../../md/02css/position.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        position定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="md/02css/transfrom.html">
            
                
                    <a href="../../md/02css/transfrom.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        transfrom变形
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="md/02css/transition.html">
            
                
                    <a href="../../md/02css/transition.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        transition过渡
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.6" data-path="md/02css/flex.html">
            
                
                    <a href="../../md/02css/flex.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        flex弹性盒子
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="md/02css/textattr.html">
            
                
                    <a href="../../md/02css/textattr.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        textattr文本属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="md/02css/git.html">
            
                
                    <a href="../../md/02css/git.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        git四步骤
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >我旳电子书</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x5F39;&#x6027;&#x76D2;&#x5B50;-displayflex">&#x5F39;&#x6027;&#x76D2;&#x5B50; display:flex</h1>
<ul>
<li>&#x610F;&#x4E49;&#xFF1A;flex &#x610F;&#x4E3A;&#x5F39;&#x6027;&#x76D2;&#x5B50;&#xFF0C;&#x4EFB;&#x4F55;&#x4E00;&#x4E2A;&#x5BB9;&#x5668;&#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x4E3A;flex</li>
<li>&#x4F18;&#x70B9;&#xFF1A;&#x5728;&#x5904;&#x7406;&#x4E00;&#x4E9B;&#x76F8;&#x5BF9;&#x590D;&#x6742;&#x7684;&#x5E03;&#x5C40;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x6BD4;&#x8F83;&#x7B80;&#x5355;&#xFF0C;&#x4F8B;&#x5982;&#x5782;&#x76F4;&#x5C45;&#x4E2D;<h3 id="&#x6CE8;&#x610F;&#xFF1A;">&#x6CE8;&#x610F;&#xFF1A;</h3>
</li>
<li>&#x5F53;&#x4F7F;&#x7528;&#x5F39;&#x6027;&#x76D2;&#x5B50;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5B50;&#x5143;&#x7D20;&#x7684;float&#xFF0C;clear&#xFF0C;vertical-align&#x5C5E;&#x6027;&#x90FD;&#x5931;&#x6548;</li>
<li>&#x5F53;&#x7236;&#x5143;&#x7D20;&#x7684;&#x5BBD;&#x5EA6;&#x5C0F;&#x4E8E;&#x5B50;&#x5143;&#x7D20;&#x7684;&#x603B;&#x5BBD;&#x5EA6;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5B50;&#x5143;&#x7D20;&#x5BBD;&#x5EA6;&#x7684;&#x8BBE;&#x7F6E;&#x5C3A;&#x5BF8;&#x5931;&#x6548;&#xFF0C;&#x52A8;&#x6001;&#x8BA1;&#x7B97;&#x51FA;&#x6BCF;&#x4E2A;&#x5B50;&#x5143;&#x7D20;&#x7684;&#x5BBD;&#x5EA6;<h3 id="&#x7236;&#x5143;&#x7D20;&#x7684;&#x8BBE;&#x7F6E;&#xFF1A;">&#x7236;&#x5143;&#x7D20;&#x7684;&#x8BBE;&#x7F6E;&#xFF1A;</h3>
</li>
<li>flex-direction&#x8BBE;&#x7F6E;&#x4E3B;&#x8F74;&#x65B9;&#x5411;&#xFF0C;&#x9ED8;&#x8BA4;row</li>
<li>row&#xFF08;X&#x8F74;&#xFF09;</li>
<li>row-reverse&#xFF08;X&#x8F74;&#x5012;&#x5E8F;&#xFF09;</li>
<li>column&#xFF08;Y&#x8F74;&#xFF09;</li>
<li>column-reverse&#xFF08;Y&#x8F74;&#x5012;&#x5E8F;&#xFF09;</li>
<li>flex-wrap&#x8BBE;&#x7F6E;&#x5B50;&#x5143;&#x7D20;&#x8D85;&#x51FA;&#x662F;&#x5426;&#x6362;&#x884C;&#xFF0C;&#x9ED8;&#x8BA4;nowrap</li>
<li>wrap&#xFF08;&#x6362;&#x884C;&#xFF09;</li>
<li>nowarp(&#x4E0D;&#x6362;&#x884C;)</li>
<li>flex-flow &#xFF08;flex-direction flex-wrap&#x7684;&#x590D;&#x5408;&#x5199;&#x6CD5;&#xFF09;</li>
<li>justify-content &#x8BBE;&#x7F6E;&#x6C34;&#x5E73;&#x65B9;&#x5411;&#x7684;&#x5BF9;&#x9F50;&#x65B9;&#x5F0F;&#xFF0C;&#x9ED8;&#x8BA4;flex-start</li>
<li>flex-start&#xFF08;&#x5DE6;&#x5BF9;&#x9F50;&#xFF09;</li>
<li>flex-end&#xFF08;&#x53F3;&#x5BF9;&#x9F50;&#xFF09;</li>
<li>center&#xFF08;&#x5C45;&#x4E2D;&#xFF09;</li>
<li>space-around&#xFF08;&#x6A2A;&#x5411;&#x7A7A;&#x9699;&#x5305;&#x56F4;&#x5B50;&#x5143;&#x7D20;&#xFF09;</li>
<li>space-between&#xFF08;&#x4FE9;&#x7AEF;&#x9876;&#x4F4F;&#xFF0C;&#x4E2D;&#x95F4;&#x5E73;&#x5747;&#x5206;&#x914D;&#x7A7A;&#x9699;&#xFF09;</li>
<li>align-items &#x8BBE;&#x7F6E;&#x4FA7;&#x8F74;&#x7684;&#x5BF9;&#x9F50;&#x65B9;&#x5F0F;&#xFF0C;&#x9ED8;&#x8BA4;flex-start</li>
<li>flex-start&#xFF08;&#x9876;&#x90E8;&#x5BF9;&#x9F50;&#xFF09;</li>
<li>flex-end&#xFF08;&#x5E95;&#x90E8;&#x5BF9;&#x9F50;&#xFF09;</li>
<li>center&#xFF08;&#x5C45;&#x4E2D;&#xFF09;</li>
<li>baseline&#xFF08;&#x57FA;&#x7EBF;&#x5BF9;&#x9F50;&#xFF09;</li>
<li>stretch&#xFF08;&#x62C9;&#x4F38; &#x9ED8;&#x8BA4;auto &#x5F53;&#x8BBE;&#x7F6E;&#x9AD8;&#x5EA6;&#x7684;&#x65F6;&#x5019;&#x65E0;&#x6548;&#xFF09;&lt;&#x4E3B;&#x8F74;&#x53EA;&#x6709;&#x4E00;&#x884C;&#x7684;&#x65F6;&#x5019;&#x4F7F;&#x7528;&gt;</li>
<li>align-content &#x8BBE;&#x7F6E;&#x591A;&#x4E2A;&#x4E3B;&#x8F74;&#x7684;&#x5BF9;&#x9F50;&#x65B9;&#x5F0F;&#xFF0C;&#x53EA;&#x80FD;&#x5728;&#x5B50;&#x5143;&#x7D20;&#x51FA;&#x73B0;&#x6362;&#x884C;&#x7684;&#x65F6;&#x5019;&lt;&#x4E3B;&#x8F74;&#x591A;&#x884C;&#x7684;&#x65F6;&#x5019;&#x4F7F;&#x7528;&gt;<h3 id="&#x5B50;&#x5143;&#x7D20;&#x7684;&#x8BBE;&#x7F6E;&#xFF1A;">&#x5B50;&#x5143;&#x7D20;&#x7684;&#x8BBE;&#x7F6E;&#xFF1A;</h3>
</li>
<li>order &#x8BBE;&#x7F6E;&#x6392;&#x5217;&#x65B9;&#x5F0F;&#xFF0C;&#x6570;&#x503C;&#x8D8A;&#x5C0F;&#x8D8A;&#x9760;&#x524D;&#xFF0C;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A;0</li>
<li>flex-grow &#x8BBE;&#x7F6E;&#x653E;&#x5927;&#x6BD4;&#x4F8B;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;1&#xFF0C;&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x4E3A;0&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5373;&#x4F7F;&#x6709;&#x591A;&#x4F59;&#x7684;&#x7A7A;&#x95F4;&#x4E5F;&#x4E0D;&#x4F1A;&#x53BB;&#x5206;&#x914D;</li>
<li>flex-shrink &#x8BBE;&#x7F6E;&#x7F29;&#x5C0F;&#x6BD4;&#x4F8B;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;1 &#x5F53;&#x7A7A;&#x95F4;&#x4E0D;&#x8DB3;&#x65F6;&#xFF0C;&#x7B49;&#x6BD4;&#x4F8B;&#x7684;&#x6240;&#x6709;&#xFF0C;&#x5F53;&#x4E00;&#x4E2A;&#x5C5E;&#x6027;&#x8BBE;&#x7F6E;&#x4E3A;0&#xFF0C;&#x5176;&#x4ED6;&#x90FD;&#x4E3A;1&#xFF0C;&#x5219;&#x7A7A;&#x95F4;&#x4E0D;&#x8DB3;&#x65F6;&#xFF0C;&#x8BBE;&#x7F6E;&#x4E3A;0&#x7684;&#x4E0D;&#x53D8;</li>
<li>flex-basis &#x8BBE;&#x7F6E;&#x5206;&#x914D;&#x65F6;&#x7684;&#x5BBD;&#x5EA6; &#x9ED8;&#x8BA4; auto&#xFF08;&#x7B49;&#x6BD4;&#x4F8B;&#xFF09;</li>
<li>flex&#xFF08;flex-grow flex-shrink flex-basis&#x7684;&#x590D;&#x5408;&#x5199;&#x6CD5;&#xFF09;</li>
<li>align-self &#x8BBE;&#x7F6E;&#x5B50;&#x5143;&#x7D20;&#x5782;&#x76F4;&#x65B9;&#x5411;&#x7684;&#x5BF9;&#x9F50;&#x65B9;&#x5F0F;</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/02css/transition.html" class="navigation navigation-prev " aria-label="Previous page: transition过渡"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/02css/textattr.html" class="navigation navigation-next " aria-label="Next page: textattr文本属性"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"image-captions":{"attributes":{"style":"left: 50%;position: relative;transform: translateX(-50%);"},"caption":"图 _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_","align":"center","variable_name":"_pictures"},"fontsettings":{"theme":"night","family":"sans","size":2},"toggle-chapters":{},"highlight":{}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book 我旳电子书 -->
</html>
